# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-latex2mathml
pkgver=3.75.2
pkgrel=2
pkgdesc="Pure Python library for LaTeX to MathML conversion"
url="https://github.com/roniemartinez/latex2mathml"
license=('MIT')
arch=('any')
depends=('python-setuptools')
makedepends=('python-build' 'python-installer' 'python-poetry-core')
checkdepends=('python-pytest' 'python-multidict' 'python-xmljson')
source=("https://github.com/roniemartinez/latex2mathml/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('a2f27f9ea678327ed4af3a5be3077aeb6426b220902f0859df33f453f8adaddd56dc3521fc052e27e00285f1d4b0397c81b8939e495f4cc3c616de4bb1511f74')

prepare() {
  cd latex2mathml-$pkgver
  sed -i '/--cov/d' pyproject.toml
}

build() {
  cd latex2mathml-$pkgver
  python -m build -nw
}

check() {
  cd latex2mathml-$pkgver
  pytest
}

package() {
  cd latex2mathml-$pkgver
  python -m installer -d "$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
